/**
 * Copyright &copy; 2020 <a href="https://github.com/somowhere/exam-system">exam-system</a> All rights reserved.
 */
package com.shanhesoft.java.modules.exam.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.shanhesoft.java.common.core.vo.PageModel;
import com.shanhesoft.java.common.persistence.service.impl.DataServiceImpl;
import com.shanhesoft.java.modules.exam.domain.OjProblems;
import com.shanhesoft.java.modules.exam.domain.dto.OjProblemsDto;
import com.shanhesoft.java.modules.exam.domain.vo.OjProblemsVo;
import com.shanhesoft.java.modules.exam.repository.OjProblemsRepository;
import com.shanhesoft.java.modules.exam.service.OjProblemsService;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * 编程题管理ServiceImpl 编程题管理
 * @author admin
 * @version 2020-09-26 20:36:04
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class OjProblemsServiceImpl extends DataServiceImpl<OjProblemsRepository, OjProblems, OjProblemsDto, String> implements OjProblemsService{
	@Override
	public void saveOrUpdate(OjProblemsDto ojProblemsDto) {
	 	super.saveOrUpdate(ojProblemsDto);
	}

	@Override
	public IPage<OjProblemsVo> findPage(PageModel pm, QueryWrapper wrapper) {
		return repository.findProblemsVoPage(pm, wrapper);
	}

	@Override
	public IPage<OjProblemsVo> getListPage(PageModel pm, QueryWrapper wrapper) {
		return repository.findProblemsVoPageWithCount(pm, wrapper);
	}

	@Override
	public IPage<OjProblemsVo> getListPageByUserId(PageModel pm, QueryWrapper wrapper) {
		return repository.findProblemsVoPageWithCountByUserId(pm, wrapper);
	}

	@Override
	public List<OjProblemsVo> getProblemIdsList(QueryWrapper wrapper) {
		return repository.findProblemsVoPageWithCount(wrapper);
	}

	@Override
	public OjProblemsVo findVoById(String id) {
		return repository.findProblemsVoById(id);
	}
}
